import time

from server import GetMapping, PostMapping


class Home:
    @GetMapping('/')
    def index(self):
        if self.get('name'):
            return f"嗨 dk!"
        else:
            return "请先登录"

    @GetMapping('/home')
    def home(self):
        print(self)


class User:
    @PostMapping('/login')
    def login(self):
        return 'login success.'

    @PostMapping('/register')
    def register(self):
        return f'register success . now:{time.ctime()}'
